home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 013 / nohard.arc / NOHARD.BAS
Encoding:
BASIC Source File  |  1986-05-02  |  2.4 KB  |  53 lines

  1. 10 '** nohard.bas
  2. 11 '** author: Daniel M. Frank, Prairie Computing
  3. 12 '** written: Madison, WI.  July 1984
  4. 13 '
  5. 14 '** this program disables access to the hard disk bios by
  6. 15 '** replacing the interrupt vector at interrupt 13H with the
  7. 16 '** original diskette routine vector (which is saved by the
  8. 17 '** fixed disk bios at interrupt 40H).  It can be used when
  9. 18 '** testing new programs, etc., to protect against accidental
  10. 19 '** or malicious damage to one's precious hard disk files.
  11. 20 '** NOTE:  This program should not be run on machines without
  12. 21 '** hard disks, since nothing is going to be at interrupt 40H,
  13. 22 '** and int 13H will then contain goose eggs.  It has only been
  14. 23 '** shown to work with the IBM and Everex fixed disk bios.
  15. 24 '** Finally, no one can protect against real clever sorts who
  16. 25 '** do things like issue format drive commands directly to the
  17. 26 '** controller.  Caveat runner, as it were.
  18. 27 '
  19. 28 '** Before running this, it is advisable to issue the
  20. 29 '** command "SET COMSPEC=A:\COMMAND.COM" to make sure
  21. 30 '** the operating system can find a command processor
  22. 31 '** after the hard disk disappears.
  23. 32 '
  24. 33 '** Once you have run it, any accesses to any hard disk
  25. 34 '** will cause an "Error accessing drive x" message.  You
  26. 35 '** can get your disk back by warm booting.
  27. 36 '
  28. 37 '** At the risk of stating the obvious, to run this, type:
  29. 38 '**  "BASICA NOHARD" and press return.  When you get a DOS
  30. 39 '** prompt back, your hard disks (and perhaps your ring
  31. 40 '** around the collar) will be gone!  By the way, if you
  32. 41 '** type DIR and can still get a directory listing, it's
  33. 42 '** because DOS 2.0 and above buffer some disk sectors,
  34. 43 '** and the OS hasn't had to go the bios yet.  After a few
  35. 44 '** (floppy) accesses, this will go away, and since the buffer
  36. 45 '** is read only anyway, it won't cause any problems.
  37. 46 '
  38. 100 def seg = 0
  39. 110 defint a-z
  40. 120 int13 = &H13 * 4
  41. 130 int40 = &H40 * 4
  42. 140 byte0 = peek (int40)
  43. 150 byte1 = peek (int40+1)
  44. 160 byte2 = peek (int40+2)
  45. 170 byte3 = peek (int40+3)
  46. 180 poke int13, byte0
  47. 190 poke int13+1, byte1
  48. 200 poke int13+2, byte2
  49. 210 poke int13+3, byte3
  50. 220 system
  51. e int13+3, byte3
  52. 220 system
  53.